package com.jiutong.service.impl;

import com.jiutong.dao.ProductDao;
import com.jiutong.dao.jiutong.ProductMapper;
import com.jiutong.pojo.Product;
import com.jiutong.service.ProductService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by sty on 2017/2/22.
 */
@Service
public class ProductServiceImpl implements ProductService {
//    @Resource
//    private ProductDao productDao;

    @Resource
    private ProductMapper productMapper;

    @Transactional
    public int saveProduct(Product product){
        int update  = productMapper.save(product.getUid(),product.getProductName());
//        if(1==1) throw new RuntimeException("test ex");
        return update;
    }
}
